package com.test.jbpm.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.test.jbpm.dao.ApproveDao;
import com.test.jbpm.domain.ApproveInfo;


@Repository
public class ApproveDaoImpl extends BaseDao implements ApproveDao {

	public void add(ApproveInfo approveInfo) {
		getHibernateTemplate().save(approveInfo);
	}

	@SuppressWarnings("unchecked")
	public List<ApproveInfo> findHistoryByTroubleTicketId(
			Integer troubleTicketId) {
		return getHibernateTemplate().find("from ApproveInfo ai where ai.troubleTicket.id=? order by ai.approveTime", troubleTicketId);
	}

}
